package com.zsjp.alc.init;

import java.util.Map;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.zsjp.alc.entity.ErrorMessage;
import com.zsjp.alc.utils.ParseErrorUtil;

/**
 * 用于初始化error.xml的类
 * 将结果放在ErrorMessage类中的静态变量里面
 * */
@Component
public class ZsjpRunner implements CommandLineRunner {
	public static Map<String, ErrorMessage> ERROR_MAP = null;
	static{
        String fileName = "src\\main\\resources\\error\\error.xml";
        try {
        	ERROR_MAP = ParseErrorUtil.getErrorMap(fileName);
           // 将结果给ErrorMessage类中的static变量
        } catch (Exception e) {
            e.printStackTrace();
        }
	}
	@Override
	public void run(String... args) throws Exception {
		
	}
}